function getWorkDir() {
    const configStorage = storages.create('config')
    return configStorage.get('workDir')
}

function getFileAbsolutePath(fileName) {
    const workDir = getWorkDir() || files.cwd()
    return `${workDir}/resources/files/${fileName}`
}

function readFile(fileName) {
    const filePath = getFileAbsolutePath(fileName)
    return files.read(filePath)
}

function openFile(fileName) {
    const filePath = getFileAbsolutePath(fileName)
    return files.open(filePath)
}

function init() {
    return {
        readFile,
        openFile
    }
}

init()
